

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>注册 - layuiAdmin</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/login.css" media="all">
  <link rel="stylesheet" href="../../layuiadmin/style/page/page7.css" media="all">
</head>
<body>


	<div class="layui-card layadmin-header">
	  <div class="layui-breadcrumb" lay-filter="breadcrumb">
	    <a lay-href="">主页</a>
	    <a><cite>组件</cite></a>
	    <a><cite>数据表格</cite></a>
	    <a><cite>数据表格的重载</cite></a>
	  </div>
	</div>
	
	<div class="layui-fluid">
	  <div class="layui-row layui-col-space15">
	    <div class="layui-col-md12">
	      <div class="layui-card">
	        <div class="layui-card-header">排班</div>
	        <div class="layui-card-body">
	        	
	          <div class="test-table-reload-btn" style="margin-bottom: 10px;">
	            
	            <form class="layui-form layui-form-pane" action="">
	            	搜索ID：
		            <div class="layui-inline">
		              <input class="layui-input" name="id" id="test-table-demoReload" autocomplete="off">
		            </div>

		            <div class="layui-inline">
		              <select name="quiz">
						<option value="">请选择问题</option>
						<option value="你工作的第一个城市">你工作的第一个城市</option>
						<option value="你的工号">你的工号</option>
						<option value="你最喜欢的老师">你最喜欢的老师</option>
	                  </select>
		            </div>


		            <button class="layui-btn" data-type="reload">搜索</button>
		        </form>
	          </div>
	           
	          <table class="layui-table" id="test-table-reload" lay-data="{url:'./test.json?v=3', cellMinWidth: 80, page: false, id:'test3'}" lay-filter="test3">
	            <thead>
	              <tr>
	                <th lay-data="{field:'id', width:80, fixed: 'left'}">ID</th>
	                <th lay-data="{field:'username', width:80, fixed: 'left'}">姓名</th>
	                <th lay-data="{field:'address', width:120, fixed: 'left'}">岗位</th>
	                <th lay-data="{field:'day01', edit: 'text', align:'center'}">01号</th>
	                <th lay-data="{field:'day02', edit: 'text', align:'center'}">02号</th>
	                <th lay-data="{field:'day03', edit: 'text', align:'center'}">03号</th>
	                <th lay-data="{field:'day04', edit: 'text', align:'center'}">04号</th>
	                <th lay-data="{field:'day05', edit: 'text', align:'center'}">05号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">06号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">07号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">08号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">09号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">10号</th>

	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">11号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">12号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">13号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">14号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">15号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">16号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">17号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">18号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">19号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">20号</th>

	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">21号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">22号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">23号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">24号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">25号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">26号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">27号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">28号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">29号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">30号</th>
	                <th lay-data="{field:'day06', edit: 'text', align:'center'}">31号</th>

	              </tr>
	            </thead>
	          </table>
	          
	        </div>
	      </div>
	    </div>
	  </div>
	</div>

  <script src="../../layuiadmin/layui/layui.js"></script>  

  <script>
  	layui.use(['form', 'table', 'laydate'], function(){
	  var form = layui.form
		  ,layer = layui.layer
		  ,table = layui.table
		  ,laydate = layui.laydate;

	  //监听单元格编辑
	  table.on('edit(test3)', function(obj){
	    var value = obj.value //得到修改后的值
	    ,data = obj.data //得到所在行所有键值
	    ,field = obj.field; //得到字段
	    layer.msg('[ID: '+ data.id +'] ' + field + ' 字段更改为：'+ value);
	  });
	});
  </script>
</body>
</html>